//
//  AFNetworkTools+Status.swift
//  ShangHaiWeiBo
//
//  Created by 蔡杰 on 16/3/1.
//  Copyright © 2016年 蔡杰. All rights reserved.
//

import Foundation

extension AFNworkTools {

    func loadStatus(since_id since_id:Int64 = 0, max_id:Int64 = 0, finished:([String: AnyObject]?) ->()){
    
       guard let accessToken =  UserAccount.sharedUserAccount.access_token else {
        
            return
        }
        let urlString = "https://api.weibo.com/2/statuses/home_timeline.json"
        var pamams: [String: AnyObject] = ["access_token" : accessToken]

        if since_id > 0 {
            pamams["since_id"] = NSNumber(longLong: since_id)
        }
        if max_id > 0 {
            pamams["max_id"] = NSNumber(longLong: max_id - 1)
        }
        
        request(.GET, URLString: urlString, parameters: pamams, finished: finished)
        
    }
}